const HEIMA_NEWS = 'heima-news-83'
const CHANNELS = 'heima-news-channel'
const SEARCH = 'heima-news-search'
export function getToken() {
  return JSON.parse(localStorage.getItem(HEIMA_NEWS)) || {}
}
export function setToken(token) {
  localStorage.setItem(HEIMA_NEWS, JSON.stringify(token))
}
export function removeToken() {
  localStorage.removeItem(HEIMA_NEWS)
}
export function setChannel(channel) {
  localStorage.setItem(CHANNELS, JSON.stringify(channel))
}
export function getChannel() {
  return JSON.parse(localStorage.getItem(CHANNELS))
}
export function setSearch(keyword) {
  localStorage.setItem(SEARCH, JSON.stringify(keyword))
}
export function getSearch() {
  return JSON.parse(localStorage.getItem(SEARCH)) || []
}
